#include "lglineedit.h"
#include "qapplication.h"
#include <QClipboard>
#include <QKeyEvent>

LGLineEdit::LGLineEdit(QWidget *parent) : QLineEdit(parent)
{

}

LGLineEdit::LGLineEdit(const QString &text, QWidget *parent) : QLineEdit(text, parent)
{

}

LGLineEdit::~LGLineEdit()
{

}

void LGLineEdit::keyPressEvent(QKeyEvent *event)
{
    if (event->modifiers() == Qt::Modifier::CTRL && event->key() == Qt::Key_C) {
        emit textChanged(qApp->clipboard()->text());
        event->ignore();
        return;
    }

    QLineEdit::keyPressEvent(event);
}
